﻿using System;
using System.Diagnostics;

namespace HgAdapter
{
	public class HgAdd : HgCommand
	{
		public void Run(string bracketFileName)
		{
			string saveCurrentDirectory = Environment.CurrentDirectory;
			Environment.CurrentDirectory = ProjectCommitInfo.Instance.ProjectPath;

			Process hgProcess = Process.Start(HgStatusStartInfo("add " + bracketFileName));
			hgProcess.WaitForExit();

			Environment.CurrentDirectory = saveCurrentDirectory;
		}
	}
}
